// @ts-nocheck
import React from 'react'
import {
  SafetyOutlined,
  LockOutlined,
  UpCircleOutlined,
  ToolOutlined,
  UserOutlined
} from "@ant-design/icons";
import { AlarmAttackIcon, AlarmOverviewIcon, AlarmListIcon, AlarmVictimIcon, AssetProfileIcon, MenuIcon, ScriptIcon, HomeIcon, SearchIcon, HostIcon, EventIcon, CertificateIcon, AuditIcon, NetworkIcon, OperationIcon, SystemIcon, UpdateIcon, DispatchIcon, ConfigIcon } from '@/assets/icons';
import accountGroupIcon from "@/assets/icons/accountGroup.png";
import accountIcon from "@/assets/icons/account.png";
import roleIcon from "@/assets/icons/role.png";
import dataSourceIcon from "@/assets/icons/dataSource.png";
import fieldIcon from "@/assets/icons/field.png";
import dataStructureIcon from "@/assets/icons/dataStructure.png";
import dataModelIcon from "@/assets/icons/dataModel.png";
import accessStrategyIcon from "@/assets/icons/accessStrategy.png";
import { THEME } from '@/constants'

export const SYSTEM_MANAGE = [
  {
    title: "用户管理",
    // path: '/administration',
    path: '/user',
    children: [
      {
        title: "组织管理",
        icon: <img src={accountGroupIcon} />,
        // path: "/administration/groups",
        path: "/user/organization",
      },
      {
        title: "账号管理",
        icon: <img src={accountIcon} />,
        // path: "/administration/account",
        path: "/user/account",
      },
      {
        title: "角色管理",
        icon: <img src={roleIcon} />,
        // path: "/administration/role",
        path: "/user/role",
      },
    ],
  },
  {
    title: "数据治理",
    path: '/dataGovernance',
    children: [
      {
        title: "数据源",
        icon: <img src={dataSourceIcon} />,
        path: "/dataGovernance/dataSources",
      },
      {
        title: "数据字典",
        icon: <img src={fieldIcon} />,
        path: "/dataGovernance/fields",
      },
      {
        title: "数据结构",
        icon: <img src={dataStructureIcon} />,
        path: "/dataGovernance/dataStructure",
      },
      {
        title: "数据模型",
        icon: <img src={dataModelIcon} />,
        path: "/dataGovernance/dataModel",
      },
      {
        title: "接入策略",
        icon: <img src={accessStrategyIcon} />,
        path: "/dataGovernance/accessStrategy",
      },
    ],
  },
  {
    title: "系统管理",
    path: '/systemManagement',
    children: [
      {
        title: "证书配置",
        icon: <CertificateIcon />,
        path: "/systemManagement/certificate",
      },
      // {
      //   title: "网络配置",
      //   icon: <NetworkIcon />,
      //   path: "/systemManagement/network",
      // },
      {
        title: "系统维护",
        icon: <ToolOutlined style={{ fontSize: 27 }} />,
        path: "/systemManagement/system",
      },
      {
        title: "升级管理",
        icon: <UpCircleOutlined style={{ fontSize: 27 }} />,
        path: "/systemManagement/update",
      },
      {
        title: "运营配置",
        icon: <OperationIcon />,
        path: "/systemManagement/operation",
      },
      {
        title: "审计日志",
        icon: <AuditIcon />,
        path: "/systemManagement/audit",
      },
      // {
      //   title: "常规配置",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/generalConfig",
      // },
      // {
      //   title: "系统时间",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/systemTime",
      // },
      // {
      //   title: "网络管理",
      //   icon: <NetworkIcon />,
      //   path: "/systemConfig/networkManage",
      // },
      // {
      //   title: "传输设置",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/transfer",
      // },
      // {
      //   title: "Snmp管理",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/snmpManage",
      // },
      // {
      //   title: "审计日志",
      //   icon: <AuditIcon />,
      //   path: "/systemConfig/auditLog",
      // },
      // {
      //   title: "安全性配置",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/secureConfig",
      // },
      // {
      //   title: "用户管理",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/userManage",
      // },
      // {
      //   title: "证书管理",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/certificateManage",
      // },
      // {
      //   title: "设备升级",
      //   icon: <UpCircleOutlined style={{ fontSize: 27 }} />,
      //   path: "/systemConfig/deviceUpgrade",
      // },
      // {
      //   title: "系统维护",
      //   icon: <ToolOutlined style={{ fontSize: 27 }} />,
      //   path: "/systemConfig/systemMaintenance",
      // },
      // {
      //   title: "PCAP检测",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/pcapDetect",
      // },
      // {
      //   title: "运营配置",
      //   icon: <CertificateIcon />,
      //   path: "/systemConfig/systemOperation",
      // },
    ],
  },
  {
    title: "安全配置",
    path: '/safeConfig',
    children: [
      {
        title: "登录配置",
        icon: <SafetyOutlined style={{ fontSize: 24 }} />,
        path: "/safeConfig/securityConfig",
      },
      {
        title: "密码规则",
        icon: <LockOutlined style={{ fontSize: 24 }} />,
        path: "/safeConfig/passwordRule",
      },
    ],
  },
];

export const TOP_NAV = {
  theme: THEME, // "dark" | "light"
  // // mode: "vertical",
  // mode: "horizontal",
  // mode: 'inline',
  // style: { width: 256 },
  // // inlineIndent: 24,
  // // inlineCollapsed: true,
  // selectedKeys: ["仪表板"],
  // defaultOpenKeys: ['调查分析'],
  options: [
    {
      title: "仪表板",
      path: "/dashboard",
    },
    {
      title: "告警",
      path: "/alarm",
    },
    {
      title: "调查分析",
      path: "/survey",
      children: [
        {
          title: "攻击事件",
          path: "/survey/attack",
        },
        {
          title: "日志检索",
          path: "/survey/log",
        },
        {
          title: "作战指挥室",
          path: "/survey/war",
        },
      ],
    },
    {
      title: "自动编排",
      path: "/program",
    },
    {
      title: "资产感知",
      path: "/asset",
    },
    {
      title: "应用服务",
      path: "/app",
    },
  ],
};

const SYSTEM_MANAGE_MAP = {}
SYSTEM_MANAGE.forEach(({ path, children }) => {
  SYSTEM_MANAGE_MAP[path] = children
})

export const SIDE_NAV = {
  ...SYSTEM_MANAGE_MAP,
  '/alarm': [
    {
      title: "列表",
      path: "/alarm/list",
      icon: <AlarmListIcon />,
    },
    {
      title: "概况",
      path: "/alarm/overview",
      icon: <AlarmOverviewIcon />,
    },
    {
      title: "攻击者",
      path: "/alarm/attack",
      icon: <AlarmAttackIcon />,
    },
    {
      title: "受害资产",
      path: "/alarm/victim",
      icon: <AlarmVictimIcon />,
    },
  ],
  '/survey/attack': [
    {
      title: "列表",
      path: "/survey/attack/list",
      icon: <AlarmListIcon />,
    },
    {
      title: "概况",
      path: "/survey/attack/overview",
      icon: <AlarmOverviewIcon />,
    },
  ],
  '/program': [
    {
      title: "剧本",
      path: "/program/workflow",
      icon: <ScriptIcon />,
    },
    {
      title: "调度",
      path: "/program/schedule",
      icon: <DispatchIcon />,
    },
    {
      title: "配置",
      icon: <ConfigIcon />,
      children: [
        {
          title: "APP",
          path: "/program/config/app",
        },
        {
          title: "脚本",
          path: "/program/config/script",
        },
      ]
    },
  ],
  '/asset': [
    {
      title: "资产管理",
      icon: <AlarmListIcon />,
      path: "/asset/manage",
    },
    {
      title: "资产概况",
      icon: <AssetProfileIcon />,
      path: "/asset/overview",
    },
  ],
  '/app': [
    {
      title: "我的应用",
      icon: <AlarmVictimIcon />,
      path: "/app/own",
    },
    {
      title: "全部应用",
      icon: <AlarmOverviewIcon />,
      path: "/app/store",
    },
  ],
}

export const BOTTOM_NAV = {
  title: 'XDR平台',
  menus: [
    {
      title: '日志检索',
      path: '/survey/log'
    },
    {
      title: '应用服务',
      path: '/app/own'
    },
    {
      title: '流程编排',
      path: '/program/workflow'
    },
  ],
  extra: [
    {
      title: '仪表板',
      path: '/dashboard',
      icon: <HomeIcon />
    },
    {
      title: '日志检索',
      path: '/survey/log',
      icon: <SearchIcon />
    },
    {
      title: '应用服务',
      path: '/app/own',
      icon: <HostIcon />
    },
    {
      title: '自动编排/配置APP',
      path: '/program/config/app',
      icon: <EventIcon />
    },
  ]
}


